<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: 曾幼九
  Date: 2023/3/5
  Time: 22:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    ArrayList<String> peoples = new ArrayList<>();
    peoples.add(0,"张三");
    peoples.add(1,"李四");
    peoples.add(2,"王五");
    peoples.add(3,"赵六");
    peoples.add(4,"钱七");
    request.setAttribute("list",peoples);
%>

<%--
var, 每一次遍历出来的变量
items, 要遍历的对象
begin, 哪里开始
end,   到哪里
step,  步长
--%>

<c:forEach var="people" items="${list}">
    <c:out value="${people}"></c:out>
    <br>
</c:forEach>

<hr>
<c:forEach var="people" items="${list}" begin="1" end="3" step="1">
    <c:out value="${people}"></c:out>
    <br>
</c:forEach>



</body>
</html>
